import { HTTP } from "../utils/http.js"
import util from "../utils/util.js"

export class mineModule extends HTTP {
	
	getMineData () {
		const userData = util.getStorage('userData')
		return this.request({
			url: '/api/Users/GetEmployeeInfo',
			data: {
				userID: userData.userID
			}
		})
	}
	
	postMineData (empName,empSex,empPhoneNumber) {
		const userData = util.getStorage('userData')
		return this.request({
			url: '/api/Users/UpEmployeeInfo',
			data: {
				userID: userData.userID,
				empName,
				empSex, 
				empPhoneNumber  
			}
		})
	}
	
	postUpdatePwd (formerPwd, userPwd) {
		const userData = util.getStorage('userData')
		return this.request({
			url: '/api/Users/UpdatePwd',
			data: {
				userID: userData.userID,
				formerPwd,
				userPwd
			}
		})
	}
	
	postSuggest (suggestText, contactWay) {
		const userData = util.getStorage('userData')
		return this.request({
			url: '/api/Suggest/Suggest',
			data: {
				userID: userData.userID,
				suggestText,
				contactWay
			}
		})
	}
	
	postPortrait(list,empID){
		return this.uploadFile({
			url: '/api/Files/IconUpload',
			files: list,
			formData: {
				"empID": empID
			}
		})
	}
	
}